#include<stdio.h>
#include"code.h"
#include<unistd.h>

double target_file_size = 1024.0;
double speed = 1.0;

void DownLoad(double size, double split)
{
    double current_total = 0.0;
    while(current_total <= size)
    {
        FlushCode(size, current_total);
        if(current_total >= size) break;
        usleep(20000);
        current_total += split;
    }
}

int main()
{
    code();
    //printf("下载中：\n");
    //DownLoad(100.0,1.0);
    //printf("下载中：\n");
    //DownLoad(512.0,2.0);
    //printf("下载中：\n");
    //DownLoad(1024.0,4.0);
    //printf("下载中：\n");
    //DownLoad(10240.0,20.0);
    return 0;
}
